<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no"/>
    <title>APP</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
</head>
<style type="text/css">
.aui-content {
    background: #ffffff;
    overflow: hidden;
    padding: 15px;
}
</style>
<body style="background-color:#FFFFFF;">
	<script id="bugFlow-template" type="text/x-dot-template">
		{{ for(var i=0,j=1; i<=it.length-1; i++,j++) {
			actionJsonArr.push(it[i]);
      var imgarr=[];
       imgarr=it[i].filepaths;
		}}
			<li >
				<i class="aui-iconfont aui-icon-mark aui-bg-warning"></i>
				<div class="aui-timeline-item">
          <div class="aui-timeline-body" onclick="openActionDetail('{{=(j)}}')">{{=it[i].deal_info}}</div>
          {{? imgarr.length>0}}
					<div class="aui-timeline-body">
            <div>已传图片</div>
            <ul class="aui-list-view aui-grid-view">
            {{ for(var t=0 ; t<=imgarr.length-1; t++) {
              var ip = $api.getStorage('ip');

              var src = 'http://'+ip+imgarr[t];
            }}
            <li class="aui-list-view-cell aui-img aui-col-xs-4" onclick="imageUtil.show('{{=src}}')">
            <img class="aui-img-object" src="{{=src}}">
            </li>
            {{ } }}
            </ul>
          </div>
          {{?}}
					<div class="aui-timeline-footer" style="text-align:right;">
					{{=it[i].operate_end_time}}
					</div>
				</div>
			</li>
		{{ } }}
	</script>
    <div class="aui-content">
        <ul class="aui-timeline" id="bugFlowDetail">

        </ul>
    </div>
</body>
<script type="text/javascript" src="../../script/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/debug.js"></script>
<script type="text/javascript" src="../../script/config.js"></script>
<script type="text/javascript" src="../../script/client.api.js"></script>
<script type="text/javascript" src="../../script/aui-alert.js"></script>
<script type="text/javascript" src="../../script/utils/ImageUtil.js"></script>

<script type="text/javascript">
	var actionJsonArr = new Array();
    function openActionDetail(index) {
        var billSn = api.pageParam.billSn;
        var billId = api.pageParam.billId;
        var stationId = api.pageParam.stationId;
        var jsonStr = "[" + $api.jsonToStr(actionJsonArr[index - 1]) + "]";
        api.openWin({
            name : 'mainActionDetailWin',
            url : '../mainActionDetailWin.html',
            opaque : true,
            bounces : false,
            pageParam : {
                billSn : billSn,
                billId : billId,
                stationId : stationId,
                actionDetail : jsonStr
            },
            vScrollBarEnabled : false
        });
    }

    apiready = function() {
        initHeader();
        //status bar style
        api.setStatusBarStyle({
            style : 'light'
        });
        var bugFlowInfo = $api.getStorage('bugFlowInfo');
        if (isExist(bugFlowInfo)) {
            if (isExist(bugFlowInfo.list)) {
                renderTemp('bugFlowDetail', 'bugFlow-template', bugFlowInfo.list);
                api.parseTapmode();
            } else if (isExist(bugFlowInfo.info)) {
                api.toast({
                    msg : bugFlowInfo.info,
                    location : 'bottom'
                });
            } else {
                api.toast({
                    msg : bugFlowInfo.error,
                    location : 'bottom'
                });
            }
        }
    };
</script>
</html>
